package com.qf.controller;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * @author xiaodoudou
 * @version V1.0
 * @Project day09_05_springmvc_upload
 * @Package com.qf.controller
 * @Description:
 * @Date 2022/7/14 21:25
 */
@Controller
@RequestMapping(("/captcha"))
public class CaptchaController {
    @RequestMapping("/test01")
    public String test01(String captcha, HttpSession session){
        String realCap = (String) session.getAttribute("captcha");
        if (realCap.equalsIgnoreCase(captcha)){
            System.out.println(1);
            return "/success.jsp";
        }else {
            System.out.println(0);
            return "/error.jsp";
        }
    }
}
